package com.jhoncy.rapid.auth.client;

import com.jhoncy.rapid.base.pojo.BasePermission;
import com.jhoncy.rapid.base.pojo.BaseUser;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author zhuangqi
 * @date 2017/7/21.
 */

@FeignClient("base-service")
public interface OpenForAuthClient {

    @RequestMapping( value = "/opAuth/user", method = RequestMethod.GET)
    BaseUser findBaseUserByUserName(@RequestParam(value = "userName") String userName);

    @RequestMapping( value = "/opAuth/permissions/{userId}", method = RequestMethod.GET)
    List<BasePermission> findBasePermissionsByUserId(@PathVariable(value = "userId") String userId);

}
